package band.wukong.practice.springboot.boot.da.jpa;


import band.wukong.practice.springboot.boot.da.entity.Musican;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author wukong(wukonggg@139.com)
 */
@Repository
interface MusicanRepositoryJpaImpl extends JpaRepository<Musican, Integer> {

    List<Musican> findByAlive(boolean alive);

    Musican findByNameAndAlive(String name, boolean alive);

    @Query("select m from Musican m where m.name = :name")
    Musican withNameQuery(@Param("name") String Name);

    Musican withNameNamedQuery(@Param("name") String Name);

}
